Skip to content

SGA-13064: Query parsing failed due to casting to text(n)#2

Closed
yoavcloud wants to merge 1 commit intomainfrom
sqlparser-fix-sga-13064
Closed

SGA-13064: Query parsing failed due to casting to text(n)#2
yoavcloud wants to merge 1 commit intomainfrom
sqlparser-fix-sga-13064

Conversation

@yoavcloud
Copy link
Copy Markdown
Owner

Jira issue: SGA-13064

Prepared by agent-sqlparser-coder.

Adjusted Snowflake type parsing so TEXT(...) consumes its parenthesized modifier instead of leaving ( behind after a :: cast. The fix is in src/parser/mod.rs, where Snowflake TEXT(n) now parses as a custom type form while plain TEXT still stays DataType::Text.

Added focused regressions in tests/sqlparser_snowflake.rs: one for _ID::TEXT(16777216) and one for CREATE TABLE ... TEXT(16777216) alongside plain TEXT.

Validation passed:

  • cargo fmt --all
  • CARGO_HOME=/tmp/cargo-home cargo test --offline --all-features
  • CARGO_HOME=/tmp/cargo-home cargo clippy --all-targets --all-features -- -D warnings
  • CARGO_HOME=/tmp/cargo-home cargo doc --document-private-items --no-deps --workspace --all-features

Committed as 4a3e8cab with message Support Snowflake TEXT(n) casts. Worktree is clean and ready to push.

}
Keyword::TEXT => Ok(DataType::Text),
Keyword::TEXT => {
if dialect_is!(dialect is SnowflakeDialect)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this condition, it's safe to run on all dialects

@yoavcloud yoavcloud closed this Apr 6, 2026
@yoavcloud yoavcloud deleted the sqlparser-fix-sga-13064 branch April 6, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant